import java.util.LinkedList;

import typeinfo.pets.Hamster;
import typeinfo.pets.Pet;
import typeinfo.pets.Pets;
import typeinfo.pets.Rat;

public class LinkedListFeatures {
	public static void main(String[] args) {
		LinkedList<Pet> pets = new LinkedList<Pet>(Pets.arrayList(5));
		System.out.println(pets);
		// Idetical;
		System.out.println("pets.getFirst():" + pets.getFirst());
		System.out.println("pets.element():" + pets.element());
		// Only differs in empty-list behavior:
		System.out.println("pets.peek():" + pets.peek());
		// identical;remove and return the first element;
		System.out.println("pets.remove():" + pets.remove());
		System.out.println("pets.removeFirst():" + pets.removeFirst());
		// Only differs in empty-list behavior:
		System.out.println("pets.poll():" + pets.poll());
		System.out.println(pets);
		pets.addFirst(new Rat());
		System.out.println("After addFirst():" + pets);
		pets.offer(new Hamster());
		System.out.println("After offer():" + pets);
		pets.addLast(new Hamster());
		System.out.println("After addLast():" + pets);
		System.out.println("pets.removeLast():" + pets.removeLast());
	}
}
